/**
* @description: 1470. 重新排列数组
* @author hewei
* @date 2022/8/29 14:21
* @version 1.0
*/

public class Shuffle {

    public int[] shuffle(int[] nums, int n) {
        int l = 0;
        int r = nums.length / 2;
        int[] ans = new int[nums.length];
        int i = 0;
        while (r < nums.length) {
            ans[i++] = nums[l++];
            ans[i++] = nums[r++];
        }
        return ans;
    }
}
